import { useState, useEffect,useContext ,createContext} from "react";
import ReactDOM from "react-dom/client";
import * as React from "react";
export interface ITodo {
    id: number;
    title: string;
    description: string;
    status: boolean;
  }
  export  type TodoContextType = {
    todos: ITodo[];
    saveTodo: (todo: ITodo) => void;
    updateTodo: (id: number) => void;
  };
 
  export type GlobalContent = {
    copy: string
    setCopy:(c: string) => void
  }
  export const MyGlobalContext = createContext<GlobalContent>({
  copy: 'Hello World', // set a default value
  setCopy: () => {
    console.log("")
  },
  })
  export const useGlobalContext = () => useContext(MyGlobalContext)
  export const TodoContext = React.createContext<TodoContextType | null>(null);
 
  export interface Theme {
    color: string;
    background: string;
  }
  
  export const ThemeContext = createContext<Theme>({
    color: 'black',
    background: 'white',
  });